<!--
 * @Description: 
 * @Author: 【大白菜】2601779853@qq.com
 * @Date: 2024-05-28 15:29:17
 * @LastEditTime: 2024-05-28 16:13:10
 * @LastEditors: 【大白菜】2601779853@qq.com
-->
<template>
  <div>
    <a-table
      :columns="columns"
      :data-source="tableData"
      :scroll="{ y: scrollY }"
      bordered
      :loading="loading"
      :pagination="false"
    >
    </a-table>
  </div>
</template>

<script>
export default {
  props: {
    scrollY: {
        type: Number,
        default: 0
    },
    loading: {
        type: Boolean,
        default: true
    },
    tableData: {
        type: Array,
        default: function() {
            return []
        }
    }
  },
  data() {
    return {
      columns: [
        {
          title: '日期',
          dataIndex: 'time',
          key: 'time',
        },
        {
          title: '车间',
          dataIndex: 'cj',
          key: 'cj',
        },
        {
          title: '车台号',
          dataIndex: 'devSn',
          key: 'devSn',
        },
        {
          title: '品种',
          dataIndex: 'pz',
          key: 'pz',
        },
        {
          title: '效率对标(%)',
          dataIndex: 'efficiency',
          key: 'efficiency',
          children: [
              { title: '理论效率', dataIndex: 'efficiencyTheory', key: 'efficiencyTheory', align: 'center' },
              { title: '机械效率', dataIndex: 'efficiencyActual', key: 'efficiencyActual', align: 'center' },
              { title: '效率偏差', dataIndex: 'efficiencyDeviation', key: 'efficiencyDeviation', align: 'center' },
          ]
        },
        {
          title: '车速对标(r/min)',
          dataIndex: 'speed',
          key: 'speed',
          children: [
              { title: '计划车速', dataIndex: 'speedTheory', key: 'speedTheory', align: 'center' },
              { title: '实际车速', dataIndex: 'speedActual', key: 'speedActual', align: 'center' },
              { title: '车速偏差', dataIndex: 'speedDeviation', key: 'speedDeviation', align: 'center' },
          ]
        },
        {
          title: '定额对标(kg)',
          dataIndex: 'quota',
          key: 'quota',
          children: [
              { title: '计划定额', dataIndex: 'quotaTheory', key: 'quotaTheory', align: 'center' },
              { title: '实际定额', dataIndex: 'quotaActual', key: 'quotaActual', align: 'center' },
              { title: '定额偏差', dataIndex: 'quotaDeviation', key: 'quotaDeviation', align: 'center' },
          ]
        },
        {
          title: '产量对标(kg)',
          dataIndex: 'yield',
          key: 'yield',
          children: [
              { title: '计划', dataIndex: 'yieldTheory', key: 'yieldTheory', align: 'center' },
              { title: '实际', dataIndex: 'yieldActual', key: 'yieldActual', align: 'center' },
              { title: '完成率', dataIndex: 'yieldCompleteRate', key: 'yieldCompleteRate', align: 'center' },
              { title: '偏差', dataIndex: 'yieldDeviation', key: 'yieldDeviation', align: 'center' },
              { title: '停台数', dataIndex: 'stopNum', key: 'stopNum', align: 'center' },
              { title: '停台时长', dataIndex: 'stopTime', key: 'stopTime', align: 'center' },
          ]
        },
        {
          title: '能耗对标(kw/h)',
          dataIndex: 'energy',
          key: 'energy',
          children: [
              { title: '计划能耗', dataIndex: 'energyTheory', key: 'energyTheory', align: 'center' },
              { title: '实际能耗', dataIndex: 'energyActual', key: 'energyActual', align: 'center' },
              { title: '能耗偏差', dataIndex: 'energyDeviation', key: 'energyDeviation', align: 'center' },
          ]
        },
        {
          title: '薪资对标(元)',
          dataIndex: 'salary',
          key: 'salary',
          children: [
              { title: '定额薪资', dataIndex: 'salaryTheory', key: 'salaryTheory', align: 'center' },
              { title: '实际薪资', dataIndex: 'salaryActual', key: 'salaryActual', align: 'center' },
              { title: '薪资偏差', dataIndex: 'salaryDeviation', key: 'salaryDeviation', align: 'center' },
          ]
        },
      ]
    }
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
</style>